import md5 from 'crypto-js/md5';

export function genMd5() {
  return {
    encrypt: (text: string) => {
      if (text) {
        return md5(text).toString();
      } else {
        throw Error("请提供需要加密的内容");
      }
    },
    decrypt: (text: string) => {
      throw Error("md5模式不支持解密");
    },
  };
}